package cn.com.self.apis.portal.entity;

import cn.com.self.apis.files.entity.Files;
import cn.com.selfsoft.smartcity.commons.entity.AbstractEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.List;

/**
 * 需求发布信息
 *
 * @author CRL
 * @date 2021/1/9 21:28
 */
@EqualsAndHashCode(callSuper = true)
@TableName("u_requirements_info")
@Data
public class RequirementsEntity extends AbstractEntity {

    @NotNull(message = "会员id不能为空")
    @ApiModelProperty(value = "会员id")
    private String memberId;

    @NotNull(message = "需求名称不能为空")
    @ApiModelProperty(value = "需求名称")
    private String title;

    @NotNull(message = "分类id不能为空")
    @NotBlank(message = "分类id不能为空")
    @ApiModelProperty(value = "需求分类（分类id）")
    private String classificationId;

    @TableField(exist = false)
    @ApiModelProperty(value = "附件")
    private List<Files> files;

    @ApiModelProperty(value = "预算金额")
    private BigInteger budgetAmount;

    @ApiModelProperty(value = "竞标范围选择(字典)")
    private String scope;

    @ApiModelProperty(value = "简介")
    private String content;

    @ApiModelProperty(value = "上架时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp startTime;

    @NotNull(message = "下架不能为空")
    @NotBlank(message = "下架不能为空")
    @ApiModelProperty(value = "投标截止时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp entTime;

    @ApiModelProperty(value = "项目状态（1竞标中、2进行中、3待评价、4已完成）")
    private String requirementsState;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @CreatedDate
    private Timestamp createDate;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @LastModifiedDate
    private Timestamp updateDate;

    @NotNull(message = "开发周期不能为空")
    @NotBlank(message = "开发周期不能为空")
    @ApiModelProperty(value = "开发周期（天）")
    private String developmentCycle;

    @ApiModelProperty(value = "需求类型（字典requirementsType:1移动端、2pc端、3小程序端、4其他）")
    private String requirementsType;

    @NotNull(message = "需求描述不能为空")
    @NotBlank(message = "需求描述不能为空")
    @ApiModelProperty(value = "需求描述")
    private String requirementsInfo;

    @ApiModelProperty(value = "接单要求")
    private String receivingInfo;

    @ApiModelProperty(value = "交付要求")
    private String payInfo;

    @ApiModelProperty(value = "电话")
    private String telephone;

    @ApiModelProperty(value = "QQ")
    private String qq;

    @ApiModelProperty(value = "微信")
    private String vxNo;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "删除状态（字典 delFlag 0正常 1已删除）")
    private String delFlag;

}
